gh-141510: Implement copy and deepcopy for frozendict#144905
gh-141510: Implement copy and deepcopy for frozendict#144905eendebakpt wants to merge 9 commits intopython:mainfrom
Conversation
|
Draft because there are failing tests are due to making cpython/Lib/test/test_descr.py Line 318 in 6ef2578 I will look into this. |
Co-authored-by: Victor Stinner <vstinner@python.org>
…n into copy_module_frozendict
Sorry, my mistake. Feel free to close the PR if it is interfering. |
Lib/copy.py
Outdated
| return type(x)(x.__func__, deepcopy(x.__self__, memo)) | ||
| d[types.MethodType] = _deepcopy_method | ||
|
|
||
| _deepcopy_dispatch = frozendict(d) |
There was a problem hiding this comment.
I would prefer to not convert it to a frozendict in this PR, since it's not directly related to supporting frozendict in copy: remove this line and revert test_descr changes.
There was a problem hiding this comment.
I'll remove it here. Do you want me to open a separate PR for this part?
There was a problem hiding this comment.
I wrote #144909 to use frozendict in multiple stdlib modules. I will to see how this PR goes before proposing changing copy._deepcopy_dispatch to frozendict.
Changes cherry-picked from #141508 by @vstinner